package com.xncoding.rocketmq.producer.callback;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;

/**
 * @ClassName : CustomSendCallback
 * @Description : 异步消息的响应回值
 * @Author : <a href="luming@huluwa.cc">luming</a>
 * @Date: 2021-04-24 16:34
 */
@Slf4j
public class AsyncSendCallback implements SendCallback {

    @Override
    public void onSuccess(SendResult sendResult) {
        log.info("发送异步消息，回执信息：{}",sendResult);
    }

    @Override
    public void onException(Throwable throwable) {
        log.error("消息发送失败：",throwable);
    }
}
